package com.jdym.back.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jdym.back.entity.Pledge;
import com.jdym.back.entity.Uploadfile;
import com.jdym.back.mapper.PutMapper;
import com.jdym.back.mapper.UploadfileMapper;
import com.jdym.back.service.UploadfileService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 上传资料 服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2021-09-20
 */
@Service
public class UploadfileServiceImpl extends ServiceImpl<UploadfileMapper, Uploadfile> implements UploadfileService {

    @Override
    public Uploadfile getUpFile(int firmId) {
        QueryWrapper queryWrapper=new QueryWrapper();
        queryWrapper.eq("firm_id",firmId);
        return baseMapper.selectOne(queryWrapper);

    }

    @Resource
    UploadfileMapper uploadfileMapper;
    @Resource
    PutMapper putMapper;

    @Override
    //查询 pledge、firm、uploadfile三表 抵押登记信息
    public List<Uploadfile> FindPleFirmUpload(){
        return uploadfileMapper.FindPleFirmUpload();

    }
    //    模糊查询 信息检索 通过企业名称
    @Override
    public List<Uploadfile> searchBuKeyWord(String keyWord) {
        return uploadfileMapper.searchBuKeyWord(keyWord);
    }
    //     更新 voucher
    public void updatePledge(Pledge pledge){
        uploadfileMapper.updatePledge(pledge);
    }
}
